package  
{
	import flash.display.MovieClip;
	import flash.printing.PrintJob;
	/**
	 * 打印程序 适应打印纸张的等比例缩放打印
	 * @author jacky
	 */
	public class printUtil
	{
		public var pj:PrintJob = new PrintJob();
		public static function printMc(mc:MovieClip) 
		{
			var pagesToPrint:uint = 0;
			if (pj.start()) {
				try {
					var w = pj.pageWidth;
					if(mc.width>w){
					var tmp = mc.width / mc.height;
					mc.height = w / tmp;
					mc.width = w;
					}
					pj.addPage(mc);
					pagesToPrint++;
				} catch (e:Error) {
		
				}if (pagesToPrint > 0) {
					pj.send();
				}
			}
		}
		
		
	}

}